#ifndef DEF_STRINGUTILS
#define DEF_STRINGUTILS

#include <string>
#include <vector>
#include <sstream>

class StringUtils
{
public:
	static inline std::string &trimAll(std::string &s)
	{   
		if(s.size() == 0)
		{
		    return s;
		}
		int val = 0;
		for (int cur = 0; cur < s.size(); cur++)
		{
			if(s[cur] != ' ' && std::isalnum(s[cur]))
			{
				s[val] = s[cur];
				val++;
			}
		}
		s.resize(val);
			return s;
	}

	static int ParseInt (const std::string str)
	{
		std::stringstream ss(str);
		int num;
		if((ss >> num).fail())
		{ 
			//ERROR 
		}
		return num;
	}


	static std::vector<std::string> explode( const std::string &delimiter, const std::string &str);
};

#endif /* DEF_STRINGUTILS */